package com.fjzx.frame.viewmodel;

import com.fjzx.androidframe.network.ApiFactory;
import com.fjzx.androidframe.network.BaseRepo;
import com.fjzx.frame.api.Api;
import com.fjzx.frame.constant.Constants;
import com.fjzx.frame.entity.BaseResponse;
import com.fjzx.frame.entity.HomeResponse;

import retrofit2.Callback;

/**
 * @author xiongyongcong
 */
public class DataRepo extends BaseRepo {
    private Api api;

    public DataRepo() {
        api = ApiFactory.getApiService(Constants.BASE_URL, Api.class);
    }

    public void getHomeArticles(int page, Callback<BaseResponse<HomeResponse>> callback) {
        api.getHomeArticals(page).enqueue(callback);
    }
}
